package com.code.day17JiHe.Stream;

import java.util.function.Function;

public class Test07Gouzhaonei {
    public static void main(String[] args) {
         method(new Function<String, Person>() {
             @Override
             public Person apply(String s) {
                 return new Person(s);
             }
         }, "张三");

         System.out.println("===================");

        method( s-> new Person(s),"张三");
        method(Person::new,"张三");
    }

    public static void method(Function<String, Person> function, String name) {
        Person person = function.apply(name);
        System.out.println(person);
    }


}
